package classes;
import interfaces.*;

import java.util.concurrent.Callable;

public class Carrot extends Food implements vegetable, Callable {
    //callable接口实现并发
    final String name = "胡萝卜";
    int energy = 50;
    private int vitamin=120;
    private int fiber=2;
    private int water=55;

    public void Show_vitamin(){
        System.out.println("维生素"+vitamin+"kj");
    }
    public void Show_fiber(){
        System.out.println("纤维"+fiber+"mg");
    }
    public void Show_water(){
        System.out.println("含水量"+water+"%");
    }
    public void saying() {
        System.out.println("摄取"+name+"的营养是：");
        System.out.println("能量"+energy+"kj");
        Show_vitamin();
        Show_fiber();
        Show_water();
    }

    @Override
    public Object call() throws Exception {
        this.saying();
        return null;
    }
}
